/** 
 * MaxRestoreButton.java
 * @author Lex
 * 2007-9-8 ����11:06:07
 */
package lex.title;

import javax.swing.Action;
import javax.swing.plaf.ButtonUI;

public class MaximizeRestoreButton extends WindowButton {
	private ButtonUI maximizeUI = null;
	private ButtonUI restoreUI = null;
	// ==================================
	private Action maximizeAction = null;
	private Action restoreAction = null;

	public MaximizeRestoreButton(ButtonUI maximizeUI, ButtonUI restoreUI) {
		super(maximizeUI, null);
		this.maximizeUI = maximizeUI;
		this.restoreUI = restoreUI;
	}

	public void setActions(Action maximizeAction, Action restoreAction) {
		this.maximizeAction = maximizeAction;
		this.restoreAction = restoreAction;
		this.setAction(this.maximizeAction);
	}

	public void setToMaxButton() {
		this.setCurrentStatus(maximizeUI, maximizeAction);
	}

	public void setToRestoreButton() {
		this.setCurrentStatus(restoreUI, restoreAction);
	}

	private void setCurrentStatus(ButtonUI ui, Action action) {
		super.setUIAndAction(ui, action);
	}
}
